Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-41711: Upgrade QuantumGraphExecutionReport to handle multiple overlapping graphs #426

Merged
merged 18 commits into from
Sep 23, 2024

Conversation

eigerx
Copy link
Contributor

@eigerx eigerx commented Jun 27, 2024

Checklist

  • ran Jenkins
  • added a release note for user-visible changes to doc/changes

Copy link

codecov bot commented Jun 27, 2024

Codecov Report

Attention: Patch coverage is 75.57604% with 106 lines in your changes missing coverage. Please review.

Project coverage is 83.22%. Comparing base (a82cb14) to head (e5d3d75).
Report is 19 commits behind head on main.

Files with missing lines Patch % Lines
python/lsst/pipe/base/quantum_provenance_graph.py 73.14% 74 Missing and 31 partials ⚠️
tests/test_quantum_provenance_graph.py 97.67% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #426      +/-   ##
==========================================
- Coverage   83.51%   83.22%   -0.30%     
==========================================
  Files          97       99       +2     
  Lines       11427    11861     +434     
  Branches     2192     2280      +88     
==========================================
+ Hits         9543     9871     +328     
- Misses       1529     1603      +74     
- Partials      355      387      +32     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@MichelleGower MichelleGower left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly suggestions about comments, but some code questions. Merge approved.


from .graph import QuantumGraph

if TYPE_CHECKING:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since only doing pass, does this if statement need to still be here?

python/lsst/pipe/base/quantum_provenance_graph.py Outdated Show resolved Hide resolved
python/lsst/pipe/base/quantum_provenance_graph.py Outdated Show resolved Hide resolved
Parameters
----------
key : `QuantumKey`
The key used to refer to the node on the graph.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Return section on docstring? (Check every method) https://developer.lsst.io/python/numpydoc.html#naming-return-variables

previous run associated with a quantum had the status FAILED,
and the status from the new graph reads SUCCESSFUL, we can
mark the overall quantum status as SUCCESSFUL and list the data_id
as RECOVERED.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this paragraph discusses the algorithm, I think it belongs in a note section.
See https://developer.lsst.io/python/numpydoc.html#extended-summary

# if we also have logs, this is a success.
if log_dataset_run.produced:
quantum_run.status = QuantumRunStatus.SUCCESSFUL
# if we have metadata and no logs, this is a very rare
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be just me, but I find it harder to read with the else comment before the else statement.

# If the most recent graph's timestamp was earlier than any of the
# previous graphs, raise a RuntimeError.
if len(qgraphs) > 1:
for previous_graph in qgraphs[: count - 1]:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand this loop. If the qgraph list is in order, don't we just need to compare current qgraph with just previous qgraph (cause the previous qgraph was already checked with the other previous qgraphs and has to have the most recent time of the previous qgraphs)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simplified!

self.__add_new_graph(butler, qgraph)
output_runs.append(qgraph.metadata["output_run"])
# If the user has not passed a `collections` variable
if not collections:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment to explain why reversing runs?

@eigerx eigerx merged commit c8ee65f into main Sep 23, 2024
11 of 13 checks passed
@eigerx eigerx deleted the tickets/DM-41711 branch September 23, 2024 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants